<!-- 支付中心主体 -->
<div class="cart-title">
    <h1>
      <i class="icon">&#x3c;</i><{t}>结算中心<{/t}>
    </h1>
  </div>
<div id="payment_container" class="payment-container">
<div class="order_i clearfix" >
      <ul>
		<a href="#"><li>
					<div class="order_icon">
					 	<div class="mouse_hide">
						<div style="height:54px; *margin-bottom:25px;">
								<i class="iconfont">&#xe62a;</i>
								<span id='order_icon'><{t}>我的购物车<{/t}></span>
						</div>
						</div> 
						<span><i class="iconfont">&#xe647;</i></span> 	 
					</div>
				</li></a>
				
				<a href="#"><li>
					<div class="order_icon">
					 	<div class="mouse_hide" >
								<i class="iconfont">&#xe630;</i>
								<span><{t}>填写订单信息<{/t}></span> 
					</div>
					<span><i class="iconfont">&#xe647;</i></span> 	
					</div>
				</li></a>
				
				<a href="#"><li>
                  <div class="order_icon">
					 	<div class="mouse">
                            <div style="height:54px; *margin-bottom:25px;">
                                    <i class="iconfont" style="color:#f69935;">&#xe62c;</i>
                                    <span id='order_icon' style="color:#f69935;"><{t}>完成订单<{/t}></span>
                            </div>
                            <div class="mouse_text"><{t}>完成订单，请等待供应商确认库存！<{/t}></div>
						</div> 
				  </div>
				</li></a>
			</ul>
        </div>
            
  <!-- 支付中心内容 -->
  <{if $newOrder == 'true'}>
  <div class="msg-success clearfix">
    <i class="iconfont">&#xe63a;</i><span class="msg-cont"><{t}>您的订单已经提交成功<{/t}><{if $order.payinfo.pay_app_id != '-1'}>,<font style="color: #f39800;"><{t}>请在供应商确认库存后付款<{/t}></font><{/if}>.</span>
  </div>
  <{/if}>
  <form action="<{$form_action}>" method="post" class="content" id="paycenter_form"<{if $order.payinfo.pay_app_id != 'deposit' || $combination_pay == 'true'}> target="_blank"<{/if}>>
    <div id="complete_main" class="payment-main">
      <table class="order-info">
        <col class="col-1">
        <col class="col-2">
        <tbody>
          <tr>
            <td width="784" colspan="2">
              <span class="span-section"><b><{t}>订单号<{/t}><{t}>：<{/t}></b><{$order.order_id}></span>
              
               <a href="<{link app=b2c ctl=site_member act=orderdetail arg0=$order.order_id}>" class="lnklike" target="_blank"><i><{t}>查看详情<{/t}></i></a>
            </td>
          </tr>
          <!--<tr>
              <td><b>收货信息：</b><{$order.consignee.addr}>（<{t}>收货人<{/t}>：<{$order.consignee.name}> <{if $order.consignee.mobile}><{t}>手机<{/t}>：<{$order.consignee.mobile}><{/if}> <{if $order.consignee.telephone}> <{t}>固话:<{/t}><{$order.consignee.telephone}><{/if}> <{if $order.consignee.zip}><{t}>邮编<{/t}>：<{$order.consignee.zip}><{/if}>）<{$order.consignee.r_time}></td>
          </tr>-->
          <tr>
            <td>
             <span class="span-section"><b><{t}>商品数量<{/t}><{t}>：<{/t}></b><{$order.quantity}></span>
              <b><{t}>您需支付<{/t}><{t}>：<{/t}></b>
              <b class="price update-current-amount" style="color:#9b9b9b; font-weight:normal;">
                <!--预售信息的判断-->
                <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time  && $order.pay_status=='0' && $prepare.status=='true' && $prepare.promotion_price > $prepare.preparesell_price
                }>
                  <{$prepare.preparesell_price|cur:$order.currency}>
                <{/if}>

                <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time  && $order.pay_status=='0' && $prepare.status=='true' && $prepare.promotion_price == $prepare.preparesell_price
                }>
                   <{$order.cur_money|cur:$order.currency}>
                <{/if}>

                <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.begin_time_final && $order.pay_status=='3'
                && $prepare.status=='true'
                }>
                  <{t}>尾款支付时间还未开始，敬请等待！<{/t}>
                <{/if}>

                <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.end_time && $prepare.nowtime < $prepare.begin_time_final && $order.pay_status=='0'
                && $prepare.status=='true'
                }>
                  <{t}>订金支付时间已过,无法支付！<{/t}>
                <{/if}>

                <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.end_time_final && ($order.pay_status=='3' || $order.pay_status=='0')
                && $prepare.status=='true'
                }>
                  <{t}>尾款支付时间已过！<{/t}>
                <{/if}>

                 <{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time_final && $prepare.nowtime < $prepare.end_time_final && $prepare.status=='true'
                }>
                  <{$order.total_amount-$prepare.preparesell_price|cur:$order.currency}>
                <{/if}>


                <{if $order.promotion_type!='prepare'}>
                  <{$order.cur_money|cur:$order.currency}>
                <{/if}>
              </b>
            </td>
          </tr>
          <tr>
            <td><{t}>您还可以<{/t}><{t}>：<{/t}><a href="./" class="lnklike" target="_blank"><i><{t}>继续购物<{/t}></i></a>         </td>
          </tr>
          <tr>
            <td><a href="<{link app=b2c ctl=site_member act=orderdetail arg0=$order.order_id}>" class="btn-lnklike" target="_blank"><{t}>查看我的订单<{/t}><i class="iconfont">&#xe614;</i></a></td>
          </tr>
        </tbody>
      </table>
      <div id="payment_center" class="payment-center">
        <div class="payment-info">
          <input type="hidden" name="payment[order_id]" value="<{$order.order_id}>">
          <!-- <input type="hidden" name="shipping[shipping_id]" value="<{$order.shipping.shipping_id}>"> -->
          <input type="hidden" name="payment[def_pay][cur_money]" value="<{$order.cur_money}>">
          <input type="hidden" name="payment[def_pay][pay_app_id]" value="<{$order.payinfo.pay_app_id}>">
          <input type="hidden" name="payment[memo]" value="<{$order.memo}>">
          <ul>
            <li class="form-item">
              <span class="form-label">
                <i><{t}>已选择支付方式<{/t}><{t}>：<{/t}></i>
              </span>
              <span class="form-act">
                <b><{if $order.payinfo.pay_name}><{$order.payinfo.pay_name}><{else}><{$order.payinfo.pay_app_id|payname}><{/if}></b>
                <{if $order.payinfo.pay_app_id != '-1'}>
                  <{if $order.payinfo.platform !='iscommon' && $order.payinfo.platform !='ispc'}>
                  <{t}>（不支持此支付方式）<{/t}>
                  <{/if}>
                <a href="javascript:void(0);" class="lnklike action-choose-payment"><{t}>选择其它支付方式<{/t}> »</a>
                <{/if}>
              </span>
            <{if $order.payinfo.pay_app_id=='deposit' && $order.promotion_type!='prepare'}>
            <{if $combination_pay == 'true' && $deposit_money - $order.cur_money < 0}>
              <input type="hidden" name="payment[combination_pay]" value="true">
              <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="unavailable"><{$deposit_money|cur_odr:$order.currency}></b> <em>(<{t}>预存款余额不足，您可以<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>为预存款充值<{/t}></a>)</em></span>
              <span class="form-act">
                <input type="checkbox" name="payment[def_pay][cur_money]" value="<{$deposit_money}>" id="" class="action-other-payment">
                <input type="hidden" name="payment[other_online][cur_money]" value="<{$order.cur_money - $deposit_money}>">
                <{if !($deposit_money-0) }>
                <{t}>当前无可用的预存款<{/t}>
                <{else}>
                <{t}>用预存款余额支付<{/t}> <b class="price"><{$deposit_money|cur_odr:$order.currency}></b>
                <{/if}>
                ,<{t}>选择其他支付方式支付剩余金额<{/t}> <b class="price update-remain-amount"><{$order.cur_money - $deposit_money|cur_odr:$order.currency}></b>
              </span>
            <{else}>
            <input type="hidden" name="payment[combination_pay]" value="false">
            <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="price"><{$deposit_money|cur_odr:$order.currency}></b> <{if $deposit_money-$order.total_amount < 0}> <em><{t}>您需要为<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>预存款充值<{/t}></a>,<{t}>充值完成后请<{/t}><a href="<{link app=b2c ctl=site_paycenter arg0=$order.order_id}>" class="lnklike"><{t}>刷新此页面<{/t}></a></em><{/if}></span>
            <{/if}>
            <{/if}>

            <{if $order.payinfo.pay_app_id=='deposit' && $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time_final && $prepare.nowtime < $prepare.end_time_final }>
            <{if $combination_pay == 'true' && $deposit_money - $prepare.preparesell_price < 0}>
              <input type="hidden" name="payment[combination_pay]" value="true">
              <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="unavailable"><{$deposit_money|cur_odr:$order.currency}></b> <em>(<{t}>预存款余额不足，您可以<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>为预存款充值<{/t}></a>)</em></span>
              <span class="form-act">
                <input type="checkbox" name="payment[def_pay][cur_money]" value="<{$deposit_money}>" id="" class="action-other-payment">
                <input type="hidden" name="payment[other_online][cur_money]" value="<{$order.cur_money - $deposit_money}>">
                <{if !($deposit_money-0) }>
                <{t}>当前无可用的预存款<{/t}>
                <{else}>
                <{t}>用预存款余额支付<{/t}> <b class="price"><{$deposit_money|cur_odr:$order.currency}></b>
                <{/if}>
                ,<{t}>选择其他支付方式支付剩余金额<{/t}> <b class="price update-remain-amount"><{$order.cur_money - $deposit_money|cur_odr:$order.currency}></b>
              </span>
            <{else}>
            <input type="hidden" name="payment[combination_pay]" value="false">
            <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="price"><{$deposit_money|cur_odr:$order.currency}></b> <{if $deposit_money-$prepare.preparesell_price < 0}> <em><{t}>您需要为<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>预存款充值<{/t}></a>,<{t}>充值完成后请<{/t}><a href="<{link app=b2c ctl=site_paycenter arg0=$order.order_id}>" class="lnklike"><{t}>刷新此页面<{/t}></a></em><{/if}></span>
            <{/if}>
            <{/if}>

             <{if $order.payinfo.pay_app_id=='deposit' && $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time }>
            <{if $combination_pay == 'true' && $deposit_money - ($order.total_amount-$prepare.preparesell_price) < 0}>
              <input type="hidden" name="payment[combination_pay]" value="true">
              <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="unavailable"><{$deposit_money|cur_odr:$order.currency}></b> <em>(<{t}>预存款余额不足，您可以<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>为预存款充值<{/t}></a>)</em></span>
              <span class="form-act">
                <input type="checkbox" name="payment[def_pay][cur_money]" value="<{$deposit_money}>" id="" class="action-other-payment">
                <input type="hidden" name="payment[other_online][cur_money]" value="<{$order.cur_money - $deposit_money}>">
                <{if !($deposit_money-0) }>
                <{t}>当前无可用的预存款<{/t}>
                <{else}>
                <{t}>用预存款余额支付<{/t}> <b class="price"><{$deposit_money|cur_odr:$order.currency}></b>
                <{/if}>
                ,<{t}>选择其他支付方式支付剩余金额<{/t}> <b class="price update-remain-amount"><{$order.cur_money - $deposit_money|cur_odr:$order.currency}></b>
              </span>
            <{else}>
            <input type="hidden" name="payment[combination_pay]" value="false">
            <span class="form-act"><{t}>预存款余额<{/t}><{t}>：<{/t}><b class="price"><{$deposit_money|cur_odr:$order.currency}></b> <{if $deposit_money-($order.total_amount-$prepare.preparesell_price) < 0}> <em><{t}>您需要为<{/t}><a href="<{link app=b2c ctl=site_member act=deposit}>" target="_blank" class="lnklike action-recharge"><{t}>预存款充值<{/t}></a>,<{t}>充值完成后请<{/t}><a href="<{link app=b2c ctl=site_paycenter arg0=$order.order_id}>" class="lnklike"><{t}>刷新此页面<{/t}></a></em><{/if}></span>
            <{/if}>
            <{/if}>

            </li>
            <{if $support_bank}>
            <{include file='site/paycenter/check_bank.html'}>
            <{/if}>
            <!-- 非货到付款或线下支付显示去付款 -->
            <{if $order.promotion_type!='prepare'}>
              <{if !($order.payinfo.pay_app_id == '-1' || $order.payinfo.pay_app_id == 'offline') && $order.c_status=='2'}>
              <li class="form-item">
                <span class="form-act">
                <{if $order.payinfo.pay_app_id == 'deposit' && ($order.payinfo.platform =='iscommon' || $order.payinfo.platform =='ispc') }>
				  <{if $deposit_money > 0}>
					<{button type="submit" class="btn-import btn-big action-prepaid" label=$___b2c="去付款"|t:'b2c'}>
				  <{/if}>
                <{else}>
                  <{if $order.payinfo.platform =='iscommon' || $order.payinfo.platform =='ispc'}>
                  <{button type="submit" class="btn-import btn-big action-pay" label=$___b2c="去付款"|t:'b2c'}>
                  <{/if}>
                <{/if}>
                </span>
              </li>
              <{/if}>
              <!--预售信息判断-->
              <{else}>

              <{if !($order.payinfo.pay_app_id == '-1' || $order.payinfo.pay_app_id == 'offline')}>
              <li class="form-item">
                <span class="form-act">
                  <!--预存款支付方式的-->
                <{if $order.payinfo.pay_app_id == 'deposit' && ($order.payinfo.platform =='iscommon' || $order.payinfo.platform =='ispc') }>


                    <{if $prepare.nowtime < $prepare.begin_time && $prepare.status=='true'}>
                      <{t}>活动还未开始!<{/t}>
                    <{/if}>

                    <{if $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time  && $order.pay_status=='0' && $prepare.status=='true' && $prepare.preparesell_price - $deposit_money <= 0}>
                      <{button type="submit" class="btn-import btn-big action-prepaid" label=$___b2c="去付订金"|t:'b2c'}>
                    <{/if}>
                    <{if $prepare.nowtime < $prepare.begin_time_final  && $order.pay_status=='3' && $prepare.status=='true'}>
                      <{button type="submit" disabled="false" class="btn-import btn-big" label=$___b2c="等待支付尾款"|t:'b2c'}>
                    <{/if}>
                    <{if $prepare.nowtime > $prepare.begin_time_final && $prepare.nowtime < $prepare.end_time_final  && $order.pay_status=='3' && $prepare.status=='true' && $deposit_money - ($order.total_amount-$prepare.preparesell_price) >= 0}>
                      <{button type="submit"  class="btn-import btn-big" action-prepaid label=$___b2c="支付尾款"|t:'b2c'}>
                    <{/if}>
                    <{if $prepare.nowtime > $prepare.end_time_final && $prepare.status=='true'}>
                      <{button type="submit" disabled="false" class="btn-import btn-big" label=$___b2c="活动结束"|t:'b2c'}>
                    <{/if}>
                <!--别的支付方式的-->
                <{else}>
                  <{if $order.payinfo.platform =='iscommon' || $order.payinfo.platform =='ispc'}>
                    <{if $prepare.nowtime < $prepare.begin_time && $prepare.status=='true'}>
                      <{t}>活动还未开始!<{/t}>
                    <{/if}>
                    <{if $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time  && $order.pay_status=='0' && $prepare.status=='true'}>
                      <{button type="submit" class="btn-import btn-big action-pay" label=$___b2c="去付订金"|t:'b2c'}>
                    <{/if}>

                    <{if $prepare.nowtime < $prepare.begin_time_final  && $order.pay_status=='3' && $prepare.status=='true'}>
                      <{button type="submit" disabled="false" class="btn-import btn-big" label=$___b2c="等待支付尾款"|t:'b2c'}>
                    <{/if}>
                    <{if $prepare.nowtime > $prepare.end_time_final && $prepare.status=='true'}>
                      <{button type="submit" disabled="false" class="btn-import btn-big" label=$___b2c="活动结束"|t:'b2c'}>
                    <{/if}>

                     <{if $prepare.nowtime > $prepare.begin_time_final && $prepare.nowtime < $prepare.end_time_final  && $order.pay_status=='3' && $prepare.status=='true'}>
                      <{button type="submit" class="btn-import btn-big" label=$___b2c="支付尾款"|t:'b2c' action-pay}>
                    <{/if}>

                  <{/if}>
                <{/if}>
                </span>
              </li>
              <{/if}>

            <{/if}>
          </ul>
          <{if $order.payinfo.pay_app_id=='deposit' && $deposit_money - $order.total_amount < 0}>
          <div id="payment_recharge" class="payment-recharge" style="display:none;">
            <p><{t}>请在新开的预存款充值页面进行充值，充值结束后请选择：<{/t}></p>
            <p><a href="javascript:location.reload();" class="btn btn-caution"><span><span><{t}>充值成功<{/t}></span></span></a>　　<a href="javascript:location.reload();" class="btn btn-simple"><span><span><{t}>充值失败<{/t}></span></span></a></p>
          </div>
          <{if $combination_pay == 'true'}>
          <div class="popup-content" style="display:none;">
            <h4><{t}>为剩余选择支付方式：<{/t}></h4>
            <div class="change-payment">
              <table>
                <tbody>
                <{foreach from=$payments item=payment_row}>
                  <{if $payment_row.app_pay_type == 'true' && $payment_row.app_id != 'deposit'}>
                  <tr>
                    <th>
                      <input type="radio" name="payment[other_online][pay_app_id]" id="" value="<{$payment_row.app_id}>" class="action-change-payment-online" vtype="requiredcustom" data-validatemsg="<{t}>请选择一种支付方式<{/t}>">
                      <label for=""><{$payment_row.app_name}></label>
                    </th>
                    <td><{$payment_row.app_pay_brief}></td>
                  </tr>
                  <{/if}>
                  <{/foreach}>
                </tbody>
                <tfoot>
                  <tr>
                    <td colspan="2">
                      <{if $order.payinfo.platform =='iscommon' || $order.payinfo.platform =='ispc'}>
                      <{button type="submit" class="btn-import btn-big action-combine-pay" label="去付款"}>
                      <{/if}>
                    </td>
                  </tr>
                </tfoot>
              </table>
            </div>
          </div>
          <{/if}>
          <{/if}>
          <{if $order.payinfo.pay_des && $order.payinfo.pay_des != '&nbsp;'}>
          <div class="payment-tips">
            <h3><{t}>温馨提示：<{/t}></h3>
            <p><{$order.payinfo.pay_des}></p>
          </div>
          <{/if}>
        </div>

      </div>
  </div>
  </form>
  
</div>

<div id="payment_online" class="payment-online" style="display:none;">
  <p><{t}>请在新开的支付平台页面进行付款，付款操作结束前请不要关闭页面，付款后选择<{/t}><{t}>：<{/t}></p>
  <div class="pay-stat">
    <div class="pay-success">
      <h4><{t}>支付成功<{/t}><{t}>：<{/t}></h4>
      <div class="action">
        <a href="<{link app=b2c ctl=site_member act=orderdetail arg0=$order.order_id}>" class="lnklike popup-btn-close"  target="_blank"><{t}>查看订单<{/t}></a>
      </div>
    </div>
    <div class="pay-failure">
      <h4><{t}>支付失败<{/t}><{t}>：<{/t}></h4>
      <div class="action">
        <a href="javascript:location.reload();" class="lnklike popup-btn-close"><{t}>重新支付<{/t}></a>
      </div>
    </div>
  </div>
</div>
<script>
Object.merge(validatorMap, {
    requiredcustom: function(element, v, type, parent){
        var name = element.name;
        if(!parent.getElements('input[type=' + type + ']' + name ? '[name="' + name + '"]' : '').some(function(el) {
            return el.checked == true && el.value != '0';
        })) {
            showWarn(parent, element.get('data-validatemsg'));
            return false;
        }
        return true;
    }
});

function hideWarn(el) {
    el.retrieve('tips_instance', {hide: function(){}}).hide();
}
function showWarn(el, msg) {
    formTips.warn(msg, el);
    return false;
}
function pay_confirm (el, method) {
    if(method == 'online') {
        new Dialog($('payment_online').wrapped(),{
            modal:true,
            width:350,
            title: '<{t}>提醒<{/t}>',
            effect: false,
            component: {
                container: 'alert-container',
                body: 'alert-body',
                header: 'alert-header',
                close: 'alert-btn-close'
            },
            onClose: function(){
                location.reload();
            }
        });
    }
    else {
        Dialog.confirm('<{t}>确定用你的预存款帐户支付这笔订单金额<{/t}><i class="price"><{if $order.promotion_type!='prepare'}><{$order.cur_money|cur:$order.currency}><{/if}><{if $order.promotion_type=='prepare' && $prepare.preparesell_price==$prepare.promotion_price}><{$order.cur_money|cur:$order.currency}><{/if}><{if $order.promotion_type=='prepare'&& $prepare.nowtime > $prepare.begin_time && $prepare.nowtime < $prepare.end_time && $prepare.preparesell_price<$prepare.promotion_price}><{$prepare.preparesell_price|cur:$order.currency}><{/if}><{if $order.promotion_type=='prepare' && $prepare.nowtime > $prepare.begin_time_final && $prepare.nowtime < $prepare.end_time_final && $prepare.preparesell_price<$prepare.promotion_price}><{$order.total_amount-$prepare.preparesell_price|cur:$order.currency}><{/if}></i>吗？', function(e){
            if(e){
                el.getParent('form').submit();
            }
        });
    }
}
function loadPayment(data) {
    new Request({
        url: 'order-payment_change.html',
        onComplete: function (rs) {
            location.reload();
        }
    }).post(data.toQueryString() + '&order_id=<{$order.order_id}>');
}

$('paycenter_form').addEvent('submit', function(e){
    this.getElement('[type=submit]').disabled = true;
});

$(document.body).addEvents({
    'click:relay(.action-choose-payment)': function(e) {
        e.stop();
        var dialog = new Dialog('order-select_payment.html', {
            width: 800,
            title: '<{t}>修改支付方式<{/t}>',
            modal: true,
            async: 'ajax',
            asyncOptions: {
                method: 'post',
                data: 'shipping[shipping_id]=<{$order.shipping.shipping_id}>&payment[def_pay][pay_app_id]=<{$order.payinfo.pay_app_id}>&prepare[promotion_type]=<{$order.promotion_type}>',
                onComplete: function() {
                    dialog.position();
                    $$('.popup-container')[0].setStyle('z-index', '10001');
                    $$('.mask')[0].setStyle('z-index', '10000');
                }
            }
        });
    },
    // 预付款提示
    'click:relay(.action-prepaid)': function(e) {
        e.stop();
        if(this.disabled) return;
        pay_confirm(this, 'prepaid');
    },
    'click:relay(.action-pay)': function(e) {
        if(this.disabled) return;
        //e.stop();
        pay_confirm(this, 'online');
    },
    //= 组合支付
    'click:relay(.action-combine-pay)': function(e) {
        var parent = this.getParent('.change-payment');
        if(validate(parent, 'all')) {
            hideWarn(parent);
            pay_confirm(target, 'online');
        }
    },
    //= 确认支付方式
    'click:relay(.action-confirm-payment)': function(e) {
        var parent = this.getParent('.change-payment');
        if(validate(parent, 'all')) {
            hideWarn(parent);
            var update = $('payment_center');
            loadPayment(parent, update);
        }
    },
    'click:relay(.action-recharge)': function(e) {
        new Dialog($('payment_recharge').wrapped(), {
            width:400,
            modal:true
        });
    },
    //= 选择支付方式
    'change:relay(.action-change-payment)': function(e){
        var selected = this.getParent('tr').addClass('selected').getSiblings('tr.selected')[0];
        selected && selected.removeClass('selected');
    },
    'change:relay(.action-other-payment)': function(e) {
        this.getParent('.payment-info').getElement('.popup-content').setStyle('display', this.checked ? '' : 'none');
    },
    'change:relay(.action-change-payment-online)':function(e){
        new Request({
            url: '<{link app=b2c ctl=site_paycenter act=get_payment_money}>',
            onComplete: function (rs) {
                rs = JSON.decode(rs);
                $$('.update-current-amount').set('text', rs.total_amount);
                $$('.update-remain-amount').set('text', rs.cur_money);
            }
        }).post($('payment_center'));
    }
});
</script>
